Qlik Community

New to Qlik Sense

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

Announcements
Support Case Portal has moved to Qlik Community! Read the FAQs to start exploring Support resources.
cancel
Showing results for 
Search instead for 
Did you mean: 
ioannagr
Creator III
Creator III

weird wrong calculation in cytd-lytd

Hi all, hope you are doing well.

Well, my metric is this

count({< CurYTDFlag={1}, [Year], [Μonth] >} [m_id])
-count({<LastYTDFlag={1}, [Year], [Μonth] >} [m_id])

The situation is this: when I comment  out the second part like :

count({< CurYTDFlag={1}, [Year], [Μonth] >} [m_id])
//-count({<LastYTDFlag={1}, [Year], [Μonth] >} [m_id])

it works. The same if i comment out the first part

//count({< CurYTDFlag={1}, [Year], [Μonth] >} [m_id])
-count({<LastYTDFlag={1}, [Year], [Μonth] >} [m_id])

 

but all together it the subtraction returns a  whatever difference i don't know where it's coming from.

What is happening here??? 😕

3 Replies
edwin
Specialist III
Specialist III

it really depends on your data model, and the dimensions you are using.  if you didnt create a bridge and used a date in the table then these two expressions wont go together.  you may want to supply more info for others to help you, the data model would help a lot

ioannagr
Creator III
Creator III
Author

Hi,
I have only one kind of date, why do i need a datebridge ?
Until tomorrow that i will be able to again revisit the model, i can describe it.
There is one main table with ids and a date and a type field.
I left joined on id this other table and because i needed to count the distinct ids in the second table i created m_id. Pretty much that is how the model looks for every type.
edwin
Specialist III
Specialist III

can you share a sample qvf?