Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
soniasweety
Master
Master

greater than value

Hi all

I have a data like below

My req is:  I need to get the data when I filter 3build I need only greater than 3days durion Renum should display

and for 5Build  I need to display more than 7Days Renum should display

by default it should display all the data.

below is expression which I used but it is not working.

=if([ Name]='3Build' and [ Duration]>=3,[ReNum])

if([Name]='5Build' and [Duration]>7,[ReNum],[ReNum]))

what is wrong in my exp?

   

ReNumNameDuration
A13Build1.2
A23Build2.2
A33Build3.5
A43Build4.5
A55Build6.7
A65Build7.6
A75Build8.6
A85Build5.4
A9ARP22.1
A10DRP33.1
A11CRP23.4
21 Replies
effinty2112
Master
Master

Hi Sony,

Try this script:

Data:

Load

*,

if(Name='3Build',sign(Duration - 3),if(Name='5Build',sign(Duration - 7),1)) as CondShow;

LOAD * Inline [

ReNum,Name,Duration

A1,3Build,1.2

A2,3Build,2.2

A3,3Build,3.5

A4,3Build,4.5

A5,5Build,6.7

A6,5Build,7.6

A7,5Build,8.6

A8,5Build,5.4

A9,ARP,22.1

A10,DRP,33.1

A11,CRP,23.4

];

Create a straight table with dimensions ReNum, Name and Duration.

Add this expression:

if(not isnull(GetCurrentSelections('|')),

CondShow + if(Wildmatch('$(=GetCurrentSelections('|'))','*' & Name & '*'),1,0),1)

You can hide this expression column.

In the Presentation tab check Suppress Zero Values.

It's a bit messy but seems to give you what you need.

Cheers

Andrew

PS

If you don't want to change your script use this expression instead

if(not isnull(GetCurrentSelections('|')),

if(Name='3Build',sign(Duration - 3),if(Name='5Build',sign(Duration - 7),1)) + if(Wildmatch('$(=GetCurrentSelections('|'))','*' & Name & '*'),1,0),1)

soniasweety
Master
Master
Author

thanks for your response.

Andrew Walker

but I have 20dimensions and one measure.  I don't know why it is not working.

but I  created separate table for full data and  for 3build one table and 5build other table.

used below exp

=count({<[name]={'5Build'},[Duration]={'>7'}>}[Renum])

and

=count({<[name]={'3Build'},[Duration]={'>3'}>}[Renum])