Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
kunkumnaveen
Specialist
Specialist

how to write expression

Hello, if i got a sample like this

number         code           value old                decision               category                date

1000                A                                           accepted                    smelting              01/01/2015

1001                A                   L1                     exception                     smelting               01/01/2015

1003                A                    L2                    exception                    smelting             01/01/2015

1004                A0                                           accepted                  smelting              01/01/2015

1005                 R                                           rejected                    smelting                01/01/2015

in a bar chart if i use

Dimension:      category,decision

expresssion:  ????????????? what expression do i need to write

so that to get this o/p

X-axis in bar chart                         count=        2                   1                        2                   

                                                                accepted       rejected              exception

expression:i wrote  this ......but the problem is how can i make this A code numbers in to two diff decision count 

=count({$<Category={'smelting'},ROLE=,SUPCAT=,MaterialName=,YEAR=,QUATERS=,name1=,date={">=$(vFromdate)<=$(vTodate)"}>}number)

19 Replies
sunny_talwar

naveen kumar wrote:

expression:i wrote  this ......but the problem is how can i make this A code numbers in to two diff decision count 

What do you mean when you say two diff decision count?

swuehl
MVP
MVP

I agree, I don't understand completely. You have one Count() expression, so maybe

=count({$<Category={'smelting'},ROLE=,SUPCAT=,MaterialName=,YEAR=,QUATERS=,name1=,date={">=$(vFromdate)<=$(vTodate)"}, code = {A} >}number)

kkkumar82
Specialist III
Specialist III

When you are giving dates from and to also input in set analysis how can get the count as you expected Naveen

kunkumnaveen
Specialist
Specialist
Author

HI,

I mean if you see code A as two decision

                         1)accepted

                          2)exception

so i want differentiate the numbers,

like code=A       count =1 for accepted

       code=A      count =2 for exception

kunkumnaveen
Specialist
Specialist
Author

as far as my known ledge based up on expression the count changes dynamic

sunny_talwar

But code is not even one of your dimension. I think you should get 2, 1, 2 as the result of your expression. Are you not getting it?

kunkumnaveen
Specialist
Specialist
Author

i think i am completely wrong with  what i said

Actually the problem is ...

if i got data like this


table1:

number     valueold             code           

1000                                     A

1001           L1                      A

1003                                     R

1004                                     A0



table2:

code                decision

A                      accepted

A0                      accepted

A                          exception

R                         rejected



so if i join these two i am like


number                code               decision

1000                        A                  accepted

1000                         A                  exception

1001                           A             accepted

1001                          A                 excception

1003                            R                    rejected

1004                            A0                   accepted


which  is wrong


i want like this

number                   code                   decision

1000                        A                  accepted

1001                          A                 excception

1003                            R                    rejected

1004                            A0                   accepted



these that valueold field based up on that i need to differentiate the codes and there numbers

but i am not sure whether to differentiate it at script or at expression level










PradeepReddy
Specialist II
Specialist II

edit: insert the image

for the bellow dimension & expressions, you will get the result as you expected..

Dimensions: category,decision

Expression: Count(number)

Test.png

nico_ilog
Partner - Creator II
Partner - Creator II

Naveem,

Your Set analysis should work as explained by the other community members.

My logic would be:

The graph's dimension = CODE

The expression1 [Exception Items] =count({$<Category={'smelting'},decision = {'exception'}>}number)

The expression2 [Accepted Items] =count({$<Category={'smelting'},decision = {'accepted'}>}number)

The expression3 [Rejected Items] =count({$<Category={'smelting'},decision = {'rejected'}>}number)

Leave out the date={">=$(vFromdate)<=$(vTodate)" for now, because if your date formats aren't the same in the Variables and in the tables then you will get null values anyway. Check to see if you get the desired results then build in the dates.

Just a FYI: Hard-coding the scenario into the graph with SET ANALYSIS, is not always ideal. If the data structure changes or more CODES | DECISIONS are added into the data, then they will be neglected, because these have been hard-coded.

IF you can't win, share the QVW into the thread, i'm sure we'll figure it out.

Nico