Skip to main content

Hi all,

 

I am analysing the approval process of various documents in a single system.

 

As the approval processes differs a lot depending on what document is, I would like to know for every single type of document, what % of cases have been regarded as the most common variant. I have read the Cloud Help documentation and came up with the PQL below but still the results differs from what I looked up individually in Variant Explorer, would you please advise what could have gone wrong in the PQL? Thanks a lot!

 

AVG(PU_COUNT (

    DOMAIN_TABLE ( "Table"."Document" ) ,

    "Table"."Document ID" ,

    INDEX_ORDER (

        PU_COUNT (

            DOMAIN_TABLE ( VARIANT ( "Table"."Action Name" ) , "Table"."Document" ) ,

            "Table"."Document ID"

        ) ,

        ORDER BY (

            PU_COUNT (

                DOMAIN_TABLE ( VARIANT ( "Table"."Action name"  ) , "Table"."Document" ) ,

                "Table"."Document ID"

            ) DESC

        ) ,

        PARTITION BY (

            PU_FIRST (

                DOMAIN_TABLE ( VARIANT ( "Table"."Action Name"  ) , "Table"."Document" ) ,

                "Table"."Document"

            )

        )

    )

    =

    1

)

/

PU_COUNT ( DOMAIN_TABLE ( "Table"."Document" ) , "Table"."Document ID" ))

 

 

 

Hi David,

 

First thing I notice is that you are using VARIANT() while the Variant Explorer uses SHORTENED(VARIANT()), see documentation on VARIANT() for more details. This can explain the difference.

 

Additionally, be aware that PU functions don't take the active filters into account by default, so if you've e.g. selected a limited time frame in your analysis you'll need to update your query.

 

Good luck!

Lucas


Reply