Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
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
Master II
Master II

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
Master II
Master II

can you share a sample qvf?