Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Diference in script and UI

Hi,

I found the  functions working diffrently from scipr and to UI level.

I am attaching the source and sample app

kindly have a look at it.

6 Replies
tresesco
MVP
MVP

The equivalent script would be like:

Temp:

LOAD

// SaleId,
Count( DISTINCT SaleId) as NewSalesID
Resident CountTest where Region='Ind' Group By Region ;

PFA

Anonymous
Not applicable
Author

Hi Tresesco,

thanks for the reply.

I would not like to restrict the region Ind in script itself, the check may vary .

So, could you please check with out the Ind selction?

Not applicable
Author

Hi John,

just note that in load script and in UI you try to do count on different level.

This is the reason why you have different result.

tresesco
MVP
MVP

Then remove the WHERE clause like:

LOAD

      Count( DISTINCT SaleId) as NewSalesID
Resident CountTest Group By Region ;

Now take Region as dimension in a chart and check the result.

Anonymous
Not applicable
Author

Hi,

Taras please find the below attachment, where i have taken the correct comparison.

still could not yield the desired result.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You are not doing the same calc in script as the UI.

In the script you are counting DISTINCT SalesID grouped by SalesID. Which can never equal anything other than 1.

In the UI, you are counting DISTINCT SalesID grouped by Region (your Dimension).

Perhaps you could explain the business problem you are trying to compute.

-Rob