Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
sona_sa
Creator II
Creator II

Expression Condition

Hi Team,

I have doubts:

I have a dimension and created it in Qlik Load Script:

Millions_Option:
Load * Inline [
Text, Value

1 Millions, 1000000

2Millions, 2000000

3Millions, 3000000

];

Now I have to created an User base selection for 1 Million and 2 Millions.... When User will select 1 Million, The record will filter >1000000 or When User will select 2 Million, The record will filter >2000000 or When User will select 3 Million, The record will filter >3000000

This is my Expression -->

if(GetFieldSelections(Options1)='Millions', if(GetFieldSelections(Options2)='No', sum({<account={'EX'},Date={'$(=vTime1)'}>}non_pti)/1000000, sum({<account={'EX'},Date={'$(=vTime1)'}>}non _pti_cc)/1000000)

Please look into the same.

Regards,

AK

Labels (1)
5 Replies
felipedl
Partner - Specialist III
Partner - Specialist III

Why not simply use a set analysis for it?

While selecting one of the options, just use something like this:
sum
(
{<
Text,
Value={">=$(=only(Value))"}
>}
Value
)

This gets only the values greater than the selection:sample.png

sona_sa
Creator II
Creator II
Author

Hi Felipedl,

Thanks for quick response. Only one doubts : Here is my expression :

[if(GetFieldSelections(Options1)='Millions', if(GetFieldSelections(Options2)='No',

sum({<account={'EX'},Date={'$(=vTime1)'}>}non_pti)/1000000,

sum({<account={'EX'},Date={'$(=vTime1)'}>}non _pti_cc)/1000000)]

As per your suggestion : Where I can add the [sum({<Text,Value={">=$(=only(Value))"}>}Value)], So I can get the value for non_pti and non _pti_cc in below expression. Because Value is division to convert the whole number to 1M, 2M and 3M. I am calculating the filed non_pti / Value and non_pti_cc / Value to conversion of 1M, 2M and 3M

[if(GetFieldSelections(Options1)='Millions', if(GetFieldSelections(Options2)='No',

sum({<account={'EX'},Date={'$(=vTime1)'}>}non_pti)/1000000,

sum({<account={'EX'},Date={'$(=vTime1)'}>}non _pti_cc)/1000000)

Regards,

AK

felipedl
Partner - Specialist III
Partner - Specialist III

Hard to tell why this is needed [if(GetFieldSelections(Options1)='Millions', if(GetFieldSelections(Options2)='No',

 

You'd have to use the expression, something like:

sum({<account={'EX'},Date={'$(=vTime1)'},Text,Value={">=$(=only(Value))"}>}non_pti)/1000000

 

That would exclude the selection on the Text field and use the Value greater than the selected Value (in my example 2.000.000) on the expression.

Can't see the actual data to say it'll work, but the set analysis would have to be something like the above.

sona_sa
Creator II
Creator II
Author

Thanks Felipedl,

I am explaining why I am using two if condition, I have 2 List Box in my App. 1st one is for Million(1.23) and Full Value (With Decimal Points --> 1000000.523) and 2nd is for Some Condition Yes or No.

Now I have to implement 3rd option that is 1M, 2M and 3M. So Once user will select the 1M = Data will select from the record the Non_Pti/1M and Non_Pti_cc/M which is >1M.

So that expression is like that : if(GetFieldSelections(Options1)='Millions', if(GetFieldSelections(Options2)='No', sum({<account={'EX'},Date={'$(=vTime1)'}>}non_pti)/1M, sum({<account={'EX'},Date={'$(=vTime1)'}>}non _pti_cc)/1M)

So I have to put the 3rd Option in the same expression, So Option 1 and Option 2 will work as it is and If there is any selection will done for Option 3, Then It will work for > than 1M, 2M and 3M.

So I stuck in this.

So that I am trying to make 3 option the the same expression, So It will work as is explained.

Hope you got my scenerio.

If you can make an expression for the same, So I can implement the same.

Thanks in Advance.

AK.

sona_sa
Creator II
Creator II
Author

Hi Felipedl,
By this expression : sum({<account={'EX'},Date={'$(=vTime1)'},Text,Value={">=$(=only(Value))"}>}non_pti)/1000000

My First Option is not working, Where I have to figure out the Millions Record.

I have 3 filter : 1st - Million or Full Value, 2nd - Yes or No and 3rd - 1M, 2M and 3 M (If user select anyone of this the >1M, >2M and >3M Records should to select for Non_Pti and Non_Pti_CC)

Regards,
AK