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: 
suvechha_b
Creator III
Creator III

How to achieve the below requirement ?

Hi All,

Is there any way to achieve the below chart .

I have the chart below . The requirement is to add the field Flag.

NewReq.PNG

The Flag condition should be .

For eg ,

The UK value - 43101_328 didnt appear in the table more than once thus Flag a 1

Thus ,

same as 43101_1653 ,43101_3373 .

Please take consideration of the whole table such a deal1, dealnm1 . The Flag should be at last.

The red highlighted row are two records . if the number 43101_828 is occuring twice the flag as 0 .

Req1.PNG

Please kindly assist .

sample model attached..

9 Replies
qlik4asif
Creator III
Creator III

What is the condition for flag?

chinnuchinni
Creator III
Creator III

can you please explore your requirement more ?

shiveshsingh
Master
Master

Add one more expression

if(column(Put dealnm1 column number) = '-',0,1)

suvechha_b
Creator III
Creator III
Author

The Flag condition should be .

For eg ,

The UK value - 43101_328 didnt appear in the table more than once thus Flag a 1

Thus ,

same as 43101_1653 ,43101_3373 .

Please take consideration of the whole table such a deal1, dealnm1 . The Flag should be at last.

qlik4asif
Creator III
Creator III

Add new expresssion as

If(Count(Disntict UK)=1,1,0)

suvechha_b
Creator III
Creator III
Author

treating as two different row thus counting as 1.PNG

The model is treating the two row as two different rows thus count as 1 thus flag as 1.

I have tried the below query in the script .

"OpenUser_final4":

NoConcatenate

LOAD

UK,

DateJoinKeyPL, 

  deal1, 

dealnm1,

     previousdealid,

     If(Count(Distinct UK)=1,1,0) as FlagLateststate  

Resident "OpenUser_final3"

GROUP BY UK,

DateJoinKeyPL, 

  deal1, 

dealnm1,

     previousdealid;


Thus getting the result as


result.PNG

imrasyed
Partner - Creator II
Partner - Creator II

try to add expression in front end table not at script level

suvechha_b
Creator III
Creator III
Author

The output is same.

output.PNG

qlik4asif
Creator III
Creator III

I don't have qlikview installed in my system .

Try this

If(Count(Total <UK> UK)=1,1,0)

or

If(Count(<UK> UK)=1,1,0)