Qlik Community

Ask a Question

New to QlikView

If you’re new to QlikView, start with this Discussion Board and get up-to-speed quickly.

Announcements
Qlik Highlights 2020 Giveaway! Watch, reply and have a chance to win a $200 Amazon Gift Card! Watch Video
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Syntax for alternate state with conditions

Hello,

I need to do a distinct count on Seq# when Payer Type = 'T' for State1 and State2. Here is what I'm using...

=Count({State2}{$<[Payer Type]={T}>} DISTINCT([Seq#]))

From what I can tell this formula renders all states, not just State2. Do I have my syntax incorrect?

Please let me know.

Thanks so much.

BW

1 Solution

Accepted Solutions
Not applicable

I tweaked what you had a little and I think this is it. Just in case anyone reads this here is the final winning combo!

=Count({State2 * $<[Payer Type]={T}>} DISTINCT([Seq#]))

Rob - thank you so much. It's so nice to be able to bounce these dilemma's off others:) Much appreciated.

BW

View solution in original post

6 Replies
MVP & Luminary
MVP & Luminary

You have too many braces. Should be:

Count({State2<[Payer Type]={T}>} DISTINCT([Seq#]))


-Rob

Not applicable

It looks like it changes by state now but when I select other filters it's disregarding them. So here's what I now have...

=Count({State2<[Payer Type]={T}>} DISTINCT([Seq#]))

Do I need to add $ somewhere to ensure the inherited filters apply?

MVP & Luminary
MVP & Luminary

I think it's back to your original syntax but with "*" between the sets:

=Count({State2 * $<[Payer Type]={T}>} DISTINCT([Seq#]))


Note corrected syntax.

Not applicable

I tweaked what you had a little and I think this is it. Just in case anyone reads this here is the final winning combo!

=Count({State2 * $<[Payer Type]={T}>} DISTINCT([Seq#]))

Rob - thank you so much. It's so nice to be able to bounce these dilemma's off others:) Much appreciated.

BW

View solution in original post

MVP & Luminary
MVP & Luminary

Glad to help. Don't forget to mark something (including your own response ) as correct to close the thread.

-Rob

Not applicable

Rob - how would this formula look if I didn't need to define payer type = T but wanted all filters not in State2 to apply?